package com.whlilong.jxc.editor.support;

import org.eclipse.jface.viewers.ComboBoxCellEditor;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.KeyEvent;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Table;

import com.whlilong.jxc.listener.IEditorListener;
import com.whlilong.jxc.listener.IModifyListener;

public class BusinessInfoComboBoxCellEditor extends ComboBoxCellEditor {
	protected IEditorListener listener;
	private int currentColumn;
	private IModifyListener modify;

	public BusinessInfoComboBoxCellEditor(Composite parent,
			IEditorListener listener, int column,
			IModifyListener modify,String[] items) {
		super(parent, items,SWT.READ_ONLY|SWT.BORDER|SWT.RIGHT);
		this.currentColumn = column;
		this.listener = listener;
		this.modify = modify;
	}
	
	public void releaseKey() {
		fireApplyEditorValue();
		deactivate();
	}

	@Override
	protected void fireApplyEditorValue() {
		super.fireApplyEditorValue();
		this.modify.modify();
	}
	
}
